module.exports = {
    port: 80,
    IPv4: 'localhost',
    // agentSev: 'http://192.168.2.11:1780',
    agentSev: 'http://101.37.173.51',
    agentSevWx: 'http://api.17find.com',//线上——业务
    //agentWufe: 'http://192.168.2.165:8080',
    //agentSev: 'http://wufeluli:8080',
    // agentSev: 'http://192.168.2.158:8088',
    // agentSevWY: 'http://192.168.2.216:8080',
    // agentIMG: 'http://101.37.77.7',
    //agentSevWW: 'http://192.168.2.216:8080',
    //agentSevCXQ: 'http://192.168.2.25:8080',
    //imgUrl: 'http://192.168.2.11:1236/php/filedownload_image.php',
    //agentSev: 'http://api.17find.com',


    getAgent: function() {
        return {
            '/server/*': {
                target: this.agentSev
            },
            '/jxt-commonbackground/*': {
                target: this.agentSev
            },
            '/jxt-nyxt/*': {
                target: this.agentSev
            },
            '/jxt-score/*': {
                target: this.agentSev
            },
            '/jxt-bbzx/*': {
                target: this.agentSev
            },
            '/jxt-api/*': {
                target: this.agentSev
            },
            '/api/*': {
                target: this.agentSev
            },
            '/api/*': {
                target: this.agentSev
            },
            '/thirdparty/*': {
                target: this.agentSevWx
            }
        }
    },
    getIP: function() {
        try {
            const network = require('os').networkInterfaces()
            this.IPv4 = network[Object.keys(network)[0]][1].address
        } catch (e) {
            this.IPv4 = '127.0.0.1';
        } finally {
            const httpStr = 'http://' + this.IPv4 + ':' + this.port;
            const opn = require('opn');
            setTimeout(function() {
                // opn(httpStr);
            }, 20000);
            return this.IPv4;
        }
    }
}
